import Vue from 'vue'
import Vuex from 'vuex'
import Category from './modules/Category'
import NewList from './modules/NewList'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {},
  getters: {
    // categoryList(state) {
    //   return state.Category.list
    // }
    // 这里的 getter 计算属性 没有任何业务逻辑，仅仅是做一个子模块 state 的快捷访问
    categoryList: state => state.Category.list,
    curCategory: state => state.Category.cur,
  },
  mutations: {},
  actions: {},
  modules: {
    Category,
    NewList,
  },
})
